<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="layout">
<head lang="en">

    <title>Product List</title>

</head>
<body>

<h2 layout:fragment="header">Product List</h2>

<div layout:fragment="content" class="container">

    <div th:if="${not #lists.isEmpty(products)}">
        <h2>Product List</h2>
        <table class="table table-striped">
            <tr>
                <th>Id</th>
                <th th:text="#{product.name}">Name</th>
                <th th:text="#{product.description}">Description</th>
                <th th:text="#{product.price}">Price</th>
                <th th:text="#{product.productDate}">Product date</th>
                <th>View</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            <tr th:each="product : ${products}">
                <td th:text="${product.id}"><a href="/product/${product.id}">Id</a></td>
                <td th:text="${product.name}">Product Name</td>
                <td th:text="${product.description}">descirption</td>
                <td th:text="${product.price}">price</td>
                <td th:text="${#dates.format(product.productDate, 'yyyy-MM-dd')}">product date</td>
                <td><a th:href="${'/product/' + product.id}">View</a></td>
                <td><a th:href="${'/product/edit/' + product.id}">Edit</a></td>
                <td><a th:href="${'/product/delete/' + product.id}">Delete</a></td>
            </tr>
        </table>

    </div>



</div>


</body>
</html>